package com.sirc.zp.mapper;

import com.sirc.zp.domain.FamilyAudit;
import com.sirc.zp.sqlprovider.FamilyAuditProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;


/**
 * 族谱审核表
 */
@Mapper
public interface FamilyAuditMapper {
    /**
     * 通过id得到FamilyAudit实体
     * @param id
     * @return
     */
    @SelectProvider(type= FamilyAuditProvider.class, method="getFamilyAuditById")
    public FamilyAudit getFamilyAuditById(Integer id);
    /**
     * 通过uid得到FamilyAudit实体
     * @param uid
     * @return
     */
    @SelectProvider(type= FamilyAuditProvider.class, method="getFamilyAuditByUId")
    public FamilyAudit getFamilyAuditByUId(Integer uid);
    /**
     * 通过status得到FamilyAudit实体
     * @param status
     * @return
     */
    @SelectProvider(type= FamilyAuditProvider.class, method="getFamilyAuditByStatus")
    public List<FamilyAudit> getFamilyAuditByStatus(Integer status);
    /**
     * 提交一个族谱审核
     * @param familyAudit 族谱审核信息
     * @return
     */
    @SelectKey(statement = "select last_insert_id()", keyProperty = "faid", before = false, resultType = int.class)
    @InsertProvider(type=FamilyAuditProvider.class, method="addFamilyAudit")
    public Integer addFamilyAudit(FamilyAudit familyAudit);
    /**
     * 更新族谱审核信息
     * @param familyAudit
     * @return
     */
    @UpdateProvider(type=FamilyAuditProvider.class, method="updateFamilyAudit")
    public Integer updateFamilyAudit(FamilyAudit familyAudit);
    /**
     * 删除用户审核信息
     * @param id
     * @return
     */
    @DeleteProvider(type=FamilyAuditProvider.class, method="deleteFamilyAudit")
    public Integer deleteFamilyAudit(Integer id);
}
